import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
Vue.use(VueRouter);

function createRouter() {
  const routes = [
    {
      path: "/",
      name: "home",
      component: Home
    },
    {
      path: "/about",
      name: "about",
      // which is lazy-loaded when the route is visited.
      component: () =>
        import(/* webpackChunkName: "about" */ "../views/About.vue")
    },
    {
      path: "/webindex/:sysno",
      name: "webindex",
      component: () => import("@/views/webindex"),
      meta: {
        title: "官网",
        noAuth: true
      }
    }
  ];
  const router = new VueRouter({
    mode: "history",
    routes
  });
  return router;
}

export default createRouter;
